#include "shellCmd.h"



static bool system_match(char *cmd)
{
	if(matchCmd(cmd, "system"))
	{
		return TRUE;
	}
	else
		return FALSE;
}
static void system_help()
{
	printf("system: \n"
		"\t info: list system info\n"
		"\t default: reset system params to default\n"
		"\t id [sid] : get or set id\n"
		"\t uart [0|1] : get or set uart params\n"
		"\t mode: get or set device protocol\n");
}
static void printsystemInfo()
{
	printf("call printsystemInfo\n");
}
static void system_default_run(int argc, char **argv)
{
	printf("call system_default_run\n");
}
static void system_id_run(int argc, char **argv)
{
	printf("call system_id_run\n");
}
static void system_uart_run(int argc, char **argv)
{
	printf("call system_uart_run\n");
}
static void system_mode_run(int argc, char **argv)
{
	printf("call system_mode_run\n");
}
static void system_run(int argc, char **argv)
{
	if(argc<=1)
	{
		system_help();
		return ;
	}
	if(matchCmd(argv[1], "info"))
	{
		printsystemInfo();
	}else if(matchCmd(argv[1], "default"))
	{
		system_default_run(argc-1, &argv[1]);
	}else if(matchCmd(argv[1], "id"))
	{
		system_id_run(argc-1, &argv[1]);
	}else  if(matchCmd(argv[1], "uart"))
	{
		system_uart_run(argc-1, &argv[1]);
	}else  if(matchCmd(argv[1], "mode"))
	{
		system_mode_run(argc-1, &argv[1]);
	}else
	{
		system_help();
	}
}
SHELL_CMD s_system = {
	.run = system_run,
	.match = system_match,
	.help = system_help,
};
